﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Commons.TypeUtil.ConverterTypes
{
    public class IntType : IConvertibility
    {

        #region IConvertibility 成员

        public object[] GetRegisterKeys()
        {
            return new object[]{typeof(int)};
        }

        public object GetValue(string strValue)
        {
            if (string.IsNullOrEmpty(strValue)) return 0;
            return Convert.ToInt32(strValue);
        }

        public string GetValueStr(object value)
        {
            return value.ToString();
        }

        #endregion
    }
}
